package cn.tedt._05mvcboot01.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {

    @RequestMapping("/bmi")
    public String BMI(Double hight,Double weight){
        Double num = weight/(hight*hight);
        String resultStr="";

        if (num>=27.00){
            resultStr= "该减肥了";
        } else if (num > 24) {
            resultStr="微胖";
        } else if (num>18.5) {
            resultStr="正常";
        }else {
            resultStr="偏瘦";
        }

        return resultStr;
    }
}
